<?php
include_once(dirname(__FILE__) . "../../TMS_TEDxCairo_DATABASE_DAO/TaskDAO.class.php");
include_once(dirname(__FILE__) . "../../TMS_TEDxCairo_DATABASE_DAO/UserDAO.class.php");

$taskDAO = new TaskDAO();
$userDao = new UserDAO();

if($_REQUEST['action']=='user'){
    if($_REQUEST['subaction']=='view'){
        $users = $userDao->listAll();
        include_once 'views/performanceUsers.html';
        exit;
    }
    elseif ($_REQUEST['subaction']=='point') {
        $userId = $_REQUEST['userId'];
        $tasks  = $taskDAO->listUserTasks($userId);
        $user   = $userDao->get($userId);
        include_once 'views/performanceUserPoints.html';
        exit;
    }
 elseif ($_REQUEST['subaction']=='userEval') {
        $users  = $taskDAO->listUsersEvaluations();
        include_once 'views/performanceUserEval.html';
        exit;
    }
 elseif($_REQUEST['subaction']=='userComp'){
        $users  = $taskDAO->listUsersEvaluations($_POST["userId"]);
        include_once 'views/performanceUserComp.html';
        exit;
 }
}elseif($_REQUEST['action']=='task'){

}
?>
